package com.cdut.hwadeefsc.service.impl;

import com.cdut.hwadeefsc.entity.awards;
import com.cdut.hwadeefsc.mapper.awardsMapper;
import com.cdut.hwadeefsc.service.awardsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class awardsServiceImpl implements awardsService {

    @Autowired
    private awardsMapper awardsMapper;

    @Override
    public List<awards> getStudentAwards(Integer studentId) {
        return awardsMapper.findByStudentId(studentId);
    }

    @Override
    public boolean addAward(awards award) {
        return awardsMapper.insert(award) > 0;
    }

    @Override
    public boolean deleteAward(Integer awardId) {
        return awardsMapper.delete(awardId) > 0;
    }
}




